The present disclosure generally relates to computer web applications. Web applications are computer software applications that use a web browser as a client, potentially allowing a software application program to run on multiple different types of operating systems so long as the web application is being hosted in a browser-controlled environment. In other words, web applications may be reliant on a web browser to make the applications executable. A web browser includes program instructions for retrieving, presenting, and traversing information resources on the World Wide Web. A web browser may be an application that is invoked independently of an operating system, or may be integrated into an operating system.
Example web applications include certain company websites, webmail websites, online retail sales and auction websites, and social networking websites. Specific examples may include GMAIL, GOOGLE MAPS, and FACEBOOK. A web application may be a web page that has client-side scripting language.
As an example, a user of a computing device may access a particular web application by launching a web browser, typing into the web browser's address bar a Uniform Resource Locator (URL) address for a web page whose rendering causes execution of a web application, and selecting an “enter” key on the user's keyboard. The web browser may send a Hypertext Transfer Protocol (HTTP) request over the internet for resources that correspond to the URL.
In response to the HTTP request, the web browser may receive from a server system a set of resources that the server system identified as relevant for the URL (e.g., HTML for a web page, a CSS document, and a JavaScript file). The web browser may execute the resources, for example, by rendering a parent HTML file and executing other resources referenced therein. The execution of the resources may cause the web browser to effectively “display” the web application on a display device.
The web browser can cache the resources for the URL in a local application cache, with the resources keyed to the URL. Upon the web browser receiving a subsequent request to navigate to the URL, the web browser may determine if resources for the URL are stored in the application cache. If so, the web browser may retrieve the resources from the application cache instead of requesting the resources over the network with an HTTP request. The local caching of application resources may increase the responsiveness of an application program, for example, because the latencies inherent in a network can be avoided. Additionally, a local cache of application resources can allow the application program to be available for execution even when the computing device is not connected to a network.
An executing set of resources for a web application may provide multiple different displayed “views” of the web application. Each view may be provided by execution of a set of resources that are associated with a single URL. Each view, however, may be specified by a “hash fragment” in the URL address (e.g., a portion of the address that follows a hash (#) symbol). The hash symbol may provide for solely client-side navigation between different states of a web application. For example, application cache keys may not include hash fragments for the URLs (e.g., because the application cache may ignore hash fragments when generating an application cache key). Thus, a single set of resources that may provide for many different views may be cached under a single URL that does not include a hash value. Similarly, the web browser may not include hash values in HTTP network requests, even when a web page or application program requests that the web browser navigate to a URL that includes a hash value.
As an illustration, a user of a computing device may launch a webmail application program by opening a web browser and navigating to the URL www.webmail.com/app. When a user selects a “Compose Email” graphical interface element, the web browser may display the present address as www.webmail.com/app#compose. Conversely, when an email inbox is displayed, the web browser may display the present address as www.webmail.com/app#inbox. The instructions for serving both the “Compose Email” display and the “Inbox” display may be provided from a single set of resources.